/* This file is part of QGoogleTranslate
 *
 * Copyright (C) 2009 Durachenko Alexei V. <lexnewton86@gmail.com>
 */

#ifndef CEDITORWIDGET_H
#define CEDITORWIDGET_H

#include <QtGui>
#include <QtNetwork>
#include "ui_editorwidget.h"

class CEditorWidget : public QWidget, public Ui::EditorWidget
{
Q_OBJECT
public:
	CEditorWidget( QWidget * parent = 0, Qt::WFlags f = 0 );
    ~CEditorWidget();

	void setTabWidget( QTabWidget* tabWidget );
	void setSourceLanguageIndex( int index );
	void setDestinationLanguageIndex( int index );
private:
    QHttp*      m_Http;
    QBuffer*    m_Buffer;
    QTabWidget* m_TabWidget;

    void setBlocking( bool state );
private slots:
	void on_toolButton_SwapLang_clicked();
	void on_pushButton_TranslateIt_clicked();
    void slot_http_done( bool );
    void slot_plainTextEdit_Input_textChanged();
public slots:
	void setSourceText( const QString& text );
	void translate();
};

#endif
